const app=new Vue({
    el:"body>article",
    data:{
        showPassword:false,
        form:{
            account:null,
            password:"123456"
        }
    },
    computed:{
        showPasswordBtnClass:function () {
            return this.showPassword?'glyphicon-eye-close':'glyphicon-eye-open';
        }
    },
    methods:{
        "onFormSubmit":function (evt) {

            axios.post("/api/session",this.form).then(function (resp) {
                if(resp.code==="ok"){
                    toast("登录成功！")
                    setTimeout(function () {
                        window.top.location.href="/index.html";
                    },1000)
                }else{
                    toast(resp.message);
                }
            });
        }
    }
});

